import random

# if语法
# if True:
#     执行1
#     执行2
age = int(input("您的年龄是："))
if age >= 18:
    print(f"您的年龄是：{age},已成年，满足上网条件。")
print("系统关闭")

# if……else……
age = int(input("您的年龄是："))
if age >= 18:
    print(f"您的年龄是：{age},已成年，满足上网条件。")
else:
    print(f"您的年龄是{age},不满足上网条件")
print("系统关闭")

# 多重判断
age = int(input("您的年龄是："))
if age < 18:
    print(f"您的年龄是{age},不满足上网条件")
elif 18 <= age <= 60:
    # elif age >= 18 and age <=60:
    print(f"您的年龄是：{age},已成年，满足上网条件。")
elif age > 60:
    print(f"您的年龄是：{age}，可以退休")
print("系统关闭")

# if嵌套
money = 1
seat = 0
if money == 1:
    print("可以上车")
    if seat == 1:
        print("可以坐")
    else:
        print("可以站")
else:
    print("不能上车")

# random.randint(起始位置,结束位置)
computer = random.randint(0, 2)
player = int(input("请出拳：0-石头，1-剪刀，2-布"))

if (player == 0 and computer == 1) or (player == 1 and computer == 2) or (player == 2 and computer == 0):
    print("玩家获胜")
elif player == computer:
    print("平局")
else:
    print("电脑获胜")

# 三目运算符
a = 1
b = 2
c = a if a < b else b
print(c)
